Skip to contentSkip to conversation

Change in openvpn[release/2.6]: Mock openvpn_exece on win32 also for test_tls_crypt

Openvpn-devel In review flichtenheld (Code Review) 3 participants 10 messages Jul 21, 2023 – Sep 25, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1689947729000.I8c8fe298eb30e211279f3fc010584b9d3bc14b4a@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Mock openvpn_exece on win32 also for test_tls_crypt

This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols.

Patch v2: Also add mock_win32_execve.c to automake files

Change-Id I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
(cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432)

---
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/mock_win32_execve.c
M tests/unit_tests/openvpn/test_pkt.c

3 files changed, 39 insertions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/313/1

tests/unit_tests/openvpn/Makefile.am +2 -1
index 650126c..6244b69 100644
@@ -77,7 +77,7 @@
 pkt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
 pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@
-pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \
+pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
@@ -104,6 +104,7 @@
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
+    mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
tests/unit_tests/openvpn/mock_win32_execve.c new file +37 -0
new file mode 100644
index 0000000..4d37ebe
@@ -0,0 +1,37 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2023 OpenVPN Inc <[email protected]...>
+ *  Copyright (C) 2023 Arne Schwabe <[email protected]...>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "syshead.h"
+
+#include "win32.h"
+
+#ifdef _WIN32
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+    ASSERT(0);
+}
+#endif
tests/unit_tests/openvpn/test_pkt.c +0 -8
index 736f131..eb69829 100644
@@ -71,14 +71,6 @@
     return "dummy print_link_socket_actual from unit test";
 }
 
-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
-{
-    ASSERT(0);
-}
-#endif
-
 struct test_pkt_context {
     struct tls_auth_standalone tas_tls_auth;
     struct tls_auth_standalone tas_crypt;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

d12fk has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Patch Set 1:

(1 comment)

File tests/unit_tests/openvpn/Makefile.am:

http://gerrit.openvpn.net/c/openvpn/+/313/comment/12e5f47b_d39e3421 :
PS1, Line 107: mock_win32_execve.c \
I think there should be a tab used here as well

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 18 Sep 2023 20:22:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: d12fk, plaisthos.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Patch Set 1:

(2 comments)

Patchset:

PS1:
Addressed via https://gerrit.openvpn.net/c/openvpn/+/342

File tests/unit_tests/openvpn/Makefile.am:

http://gerrit.openvpn.net/c/openvpn/+/313/comment/2c275af6_6df4bda3 :
PS1, Line 107: mock_win32_execve.c \

Quoted 1 line

I think there should be a tab used here as well

Will put this change into a separate patch it make it easier to merge in both master and release/2.6.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-Comment-Date: Tue, 19 Sep 2023 11:45:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: d12fk <[email protected]...>
Gerrit-MessageType: comment

#4 lore raw
In reply to a message not in the archive

Attention is currently required from: d12fk.

Hello plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/313?usp=email

to look at the new patch set (#2).

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Mock openvpn_exece on win32 also for test_tls_crypt

This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols.

Patch v2: Also add mock_win32_execve.c to automake files

Change-Id I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
(cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432)

---
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/mock_win32_execve.c
M tests/unit_tests/openvpn/test_pkt.c

3 files changed, 39 insertions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/313/2

tests/unit_tests/openvpn/Makefile.am +2 -1
index 650126c..dd3985d 100644
@@ -77,7 +77,7 @@
 pkt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
 pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@
-pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \
+pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
@@ -104,6 +104,7 @@
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
+	mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
tests/unit_tests/openvpn/mock_win32_execve.c new file +37 -0
new file mode 100644
index 0000000..4d37ebe
@@ -0,0 +1,37 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2023 OpenVPN Inc <[email protected]...>
+ *  Copyright (C) 2023 Arne Schwabe <[email protected]...>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "syshead.h"
+
+#include "win32.h"
+
+#ifdef _WIN32
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+    ASSERT(0);
+}
+#endif
tests/unit_tests/openvpn/test_pkt.c +0 -8
index 736f131..eb69829 100644
@@ -71,14 +71,6 @@
     return "dummy print_link_socket_actual from unit test";
 }
 
-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
-{
-    ASSERT(0);
-}
-#endif
-
 struct test_pkt_context {
     struct tls_auth_standalone tas_tls_auth;
     struct tls_auth_standalone tas_crypt;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-CC: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: plaisthos <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-MessageType: newpatchset

#5 lore raw
In reply to a message not in the archive

Attention is currently required from: d12fk.

flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Patch Set 2:

(1 comment)

Patchset:

PS2:
Merged the fixup from master

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: plaisthos <[email protected]...>
Gerrit-Attention: d12fk <[email protected]...>
Gerrit-Comment-Date: Fri, 22 Sep 2023 16:30:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

#6 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld.

d12fk has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 22 Sep 2023 20:00:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#7 lore raw

PATCH 1/1 Mock openvpn_exece on win32 also for test_tls_crypt

In reply to a message not in the archive

From: Arne Schwabe <[email protected]...>

This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols.

Patch v2: Also add mock_win32_execve.c to automake files

Change-Id I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
(cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432)

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to release/2.6.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/313
This mail reflects revision 2 of this Change. Acked-by according to Gerrit (reflected above):
Heiko Hund <[email protected]...>

tests/unit_tests/openvpn/Makefile.am +2 -1
index 650126c..dd3985d 100644
@@ -77,7 +77,7 @@
 pkt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
 pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@
-pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \
+pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
@@ -104,6 +104,7 @@
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
+	mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
tests/unit_tests/openvpn/mock_win32_execve.c new file +37 -0
new file mode 100644
index 0000000..4d37ebe
@@ -0,0 +1,37 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2023 OpenVPN Inc <[email protected]...>
+ *  Copyright (C) 2023 Arne Schwabe <[email protected]...>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "syshead.h"
+
+#include "win32.h"
+
+#ifdef _WIN32
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+    ASSERT(0);
+}
+#endif
tests/unit_tests/openvpn/test_pkt.c +0 -8
index 736f131..eb69829 100644
@@ -71,14 +71,6 @@
     return "dummy print_link_socket_actual from unit test";
 }
 
-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
-{
-    ASSERT(0);
-}
-#endif
-
 struct test_pkt_context {
     struct tls_auth_standalone tas_tls_auth;
     struct tls_auth_standalone tas_crypt;
#8 lore raw

[Openvpn-devel] [PATCH applied] Re: Mock openvpn_exece on win32 also for test_tls_crypt

"It does something", namely, build a pkt_testdriver-mock_win32_execve.o and link that to pkt_testdriver.exe (on my mingw test system). And I seem to remember that's all it intends to do - so the ...execve.o can be used by another test driver in one of the next patches.

Your patch has been applied to the release/2.6 branch.

commit 2ecad2403c4589f204e0fc7d1c9218f016c1de07

Author: Arne Schwabe
Date:   Mon Sep 25 11:44:09 2023 +0200
     Mock openvpn_exece on win32 also for test_tls_crypt

     Signed-off-by: Arne Schwabe <[email protected]...>
     Acked-by: Heiko Hund <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg27097.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#9 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by d12fk

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Mock openvpn_exece on win32 also for test_tls_crypt

This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols.

Patch v2: Also add mock_win32_execve.c to automake files

Change-Id I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
(cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432)

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27097.html

---
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/mock_win32_execve.c
M tests/unit_tests/openvpn/test_pkt.c

3 files changed, 39 insertions(+), 9 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/13/313/3

tests/unit_tests/openvpn/Makefile.am +2 -1
index 650126c..dd3985d 100644
@@ -77,7 +77,7 @@
 pkt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
 pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@
-pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \
+pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
@@ -104,6 +104,7 @@
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
+	mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
tests/unit_tests/openvpn/mock_win32_execve.c new file +37 -0
new file mode 100644
index 0000000..4d37ebe
@@ -0,0 +1,37 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2023 OpenVPN Inc <[email protected]...>
+ *  Copyright (C) 2023 Arne Schwabe <[email protected]...>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "syshead.h"
+
+#include "win32.h"
+
+#ifdef _WIN32
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+    ASSERT(0);
+}
+#endif
tests/unit_tests/openvpn/test_pkt.c +0 -8
index 736f131..eb69829 100644
@@ -71,14 +71,6 @@
     return "dummy print_link_socket_actual from unit test";
 }
 
-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
-{
-    ASSERT(0);
-}
-#endif
-
 struct test_pkt_context {
     struct tls_auth_standalone tas_tls_auth;
     struct tls_auth_standalone tas_crypt;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset

#10 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/313?usp=email )

Change subject: Mock openvpn_exece on win32 also for test_tls_crypt
......................................................................

Mock openvpn_exece on win32 also for test_tls_crypt

This function is needed to commpile on win32 as run_command.c defines it on Unix Linux but on windows it is defined in win32.c which pulls in too many other unresolvable symbols.

Patch v2: Also add mock_win32_execve.c to automake files

Change-Id I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
(cherry picked from commit ede590e57c96c2b16d9bf462c4b1dd967b37c432)

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27097.html

---
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/mock_win32_execve.c
M tests/unit_tests/openvpn/test_pkt.c

3 files changed, 39 insertions(+), 9 deletions(-)
tests/unit_tests/openvpn/Makefile.am +2 -1
index 650126c..dd3985d 100644
@@ -77,7 +77,7 @@
 pkt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
 	-I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn
 pkt_testdriver_LDFLAGS = @TEST_LDFLAGS@
-pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h \
+pkt_testdriver_SOURCES = test_pkt.c mock_msg.c mock_msg.h mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
@@ -104,6 +104,7 @@
 	-Wl,--wrap=parse_line \
 	-Wl,--wrap=rand_bytes
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
+	mock_win32_execve.c \
 	$(top_srcdir)/src/openvpn/argv.c \
 	$(top_srcdir)/src/openvpn/base64.c \
 	$(top_srcdir)/src/openvpn/buffer.c \
tests/unit_tests/openvpn/mock_win32_execve.c new file +37 -0
new file mode 100644
index 0000000..4d37ebe
@@ -0,0 +1,37 @@
+/*
+ *  OpenVPN -- An application to securely tunnel IP networks
+ *             over a single TCP/UDP port, with support for SSL/TLS-based
+ *             session authentication and key exchange,
+ *             packet encryption, packet authentication, and
+ *             packet compression.
+ *
+ *  Copyright (C) 2023 OpenVPN Inc <[email protected]...>
+ *  Copyright (C) 2023 Arne Schwabe <[email protected]...>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with this program; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "syshead.h"
+
+#include "win32.h"
+
+#ifdef _WIN32
+int
+openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
+{
+    ASSERT(0);
+}
+#endif
tests/unit_tests/openvpn/test_pkt.c +0 -8
index 736f131..eb69829 100644
@@ -71,14 +71,6 @@
     return "dummy print_link_socket_actual from unit test";
 }
 
-#ifdef _WIN32
-int
-openvpn_execve(const struct argv *a, const struct env_set *es, const unsigned int flags)
-{
-    ASSERT(0);
-}
-#endif
-
 struct test_pkt_context {
     struct tls_auth_standalone tas_tls_auth;
     struct tls_auth_standalone tas_crypt;

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/313?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: release/2.6
Gerrit-Change-Id: I8c8fe298eb30e211279f3fc010584b9d3bc14b4a
Gerrit-Change-Number: 313
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: d12fk <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: plaisthos <[email protected]...>
Gerrit-MessageType: merged